Objective: Childhood cancer is a leading cause of child deaths in affluent countries, but little is known about its aetiology. Psychological stress has been suggested to be associated with cancer in adults; whether this is also seen in childhood cancer is largely unknown. We investigated the association between bereavement as an indicator of severe childhood stress exposure and childhood cancer, using data from Danish and Swedish national registers. Design: Population-based cohort study. Setting: Denmark and Sweden. Participants: All live-born children born in Denmark between 1968 and 2007 (n=2 729 308) and in Sweden between 1973 and 2006 (n=3 395 166) were included in this study. Exposure was bereavement by the death of a close relative before 15 years of age. Follow-up started from birth and ended at the first of the following: date of a cancer diagnosis, death, emigration, day before their 15th birthday or end of follow-up (2007 in Denmark, 2006 in Sweden). Outcome measures: Rates and HRs for all childhood cancers and specific childhood cancers. Results: A total of 1 505 938 (24.5%) children experienced bereavement at some point during their childhood and 9823 were diagnosed with cancer before the age of 15 years. The exposed children had a small (10%) increased risk of childhood cancer (HR 1.10; 95% CI 1.04 to 1.17). For specific cancers, a significant association was seen only for central nervous system tumours (HR 1.14; 95% CI 1.02 to 1.28). Conclusions: Our data suggest that psychological stress in early life is associated with a small increased risk of childhood cancer.